From: kaf24@firebug.cl.cam.ac.uk Date: Thu, 13 Apr 2006 10:25:03 +0000 (+0100) Subject: Use memmove instead of memcpy for overlapping areas (console scroll). X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16158^2~2^2~27 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=9d66d09ba2000d3b9c81fd60eb8e8feb152263e1;p=xen.git Use memmove instead of memcpy for overlapping areas (console scroll). Use memset instead of memcpy to clear line. Signed-off-by: Tristan Gingold --- diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 948000c743..41ce2b6009 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -180,12 +180,10 @@ static void put_newline(void) if (ypos >= LINES) { - static char zeroarr[2*COLUMNS] = { 0 }; ypos = LINES-1; - memcpy((char*)video, - (char*)video + 2*COLUMNS, (LINES-1)*2*COLUMNS); - memcpy((char*)video + (LINES-1)*2*COLUMNS, - zeroarr, 2*COLUMNS); + memmove((char*)video, + (char*)video + 2*COLUMNS, (LINES-1)*2*COLUMNS); + memset((char*)video + (LINES-1)*2*COLUMNS, 0, 2*COLUMNS); } }